// Process2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "../WinAPI/WinAPI.h"


int main(int argc, char * argv[])
{
	// Local variables
	SYSTEMTIME sysTime;

	// Function body
	// Get local time
	GetLocalTime(&sysTime);
	printf_s("Process2.exe starts at %02u:%02u:%02u on %4u/%02u/%02u.\n", \
			  sysTime.wHour, sysTime.wMinute, sysTime.wSecond, sysTime.wYear, sysTime.wMonth, sysTime.wDay);

	// 1. Sleep 2000 ms
	Sleep(2000);

	// 2. Call process 3
	CallExe("Process3.exe", true);

	// Get local time
	GetLocalTime(&sysTime);
	printf_s("Process2.exe terminates at %02u:%02u:%02u on %4u/%02u/%02u.\n", \
			  sysTime.wHour, sysTime.wMinute, sysTime.wSecond, sysTime.wYear, sysTime.wMonth, sysTime.wDay);

	return 0;
}

